<template>
  <div class="line2-item">
    <Select v-for="(item, index) in returnTypeList" :key="index" v-model="item.couponId" :disabled="setDisabled" class="mt20 w200">
      <Option v-for="(child, i) in listData" :key="i" :value="child.value">{{ child.label }}</Option>
    </Select>
  </div>
</template>
<script>
export default {
  props: {
    returnTypeList: {
      type: Array,
      default: () => []
    },
    setDisabled: {
      type: Boolean,
      default: () => false
    }
  },
  data () {
    return {
      listData: []
    }
  },
  created () {
    this.getData()
  },
  methods: {
    getData () {
      this.$store.dispatch('getGiftCouponList').then(res => {
        this.listData = (res || []).map(item => {
          return {
            value: item.id,
            label: item.couponName
          }
        })
      })
    }
  }
}
</script>
